#ifndef __FS_FILESTD_H__
#define __FS_FILESTD_H__

#include <ifile.h>
#include <stdio.h>
#include <string>

/**
 * \addtogroup engine
 * @{
 */
/**
 * @brief Reading and writing standard files within the filesystem.
 */
class ceFileStd : public iFile
{
  CE_OBJECT
private:
	FILE*		_file;

  std::string _name;
  std::string _extension;
  std::string _location;

	bool		_read;
	bool		_write;

public:
  ceFileStd();
  virtual ~ceFileStd ();

  bool Open (const char* filename, ceOpenMode mode, ceTextMode textMode);

	virtual bool IsOpen() const;

	virtual bool Close();

	virtual bool IsRandomAccess () const;

	virtual bool IsReadable () const;

	virtual bool IsWritable () const;

  virtual bool Seek (ceSeekPos pos, long num);

	virtual long Tell ();

	virtual long GetLength();

	virtual long Read (void* buffer, long size);

	virtual long Write (const void* buffer, long size);

  virtual const std::string& GetLocation () const;

  virtual const std::string& GetName () const;

  virtual const std::string& GetExtension () const;

};

/** @} */

#endif /* ! __FSFILESTD_H__ */
